# -*- coding: utf-8 -*-
from __future__ import print_function
from ddl_platform.ddlib import trainer
from job import CifarResNetJob
import os, argparse

def train(conf='job.yaml'):
    conf_yaml = os.path.join(os.path.split(os.path.realpath(__file__))[0], conf)
    job = CifarResNetJob(conf_yaml)
    t = trainer.Trainer(job)
    t.fit()

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--yaml', type=str, help='indicates the job yaml name', default='job.yaml')
    
    opt = parser.parse_args()
    train(opt.yaml)
